package com.fsm.demo.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.mybatisflex.core.keygen.KeyGenerators;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 *  客户信息实体类。
 *
 * @author 翻山鸣
 * @since
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "客户信息")
@Table("client_info")
public class ClientInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
    * id
    */
    @Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
    @Schema(description = "id")
    private String id;

    /**
    * 姓名
    */
    @Column(value = "name")
    @Schema(description = "姓名")
    private String name;

    /**
    * 冻结状态（0：冻结；1：未冻结）
    */
    @Column(value = "freeze_state",onInsertValue = "1")
    @Schema(description = "冻结状态（0：冻结；1：未冻结）")
    private Integer freezeState;

    /**
    * 审核状态（0：未审核；1：已通过；2：未通过）
    */
    @Column(value = "auditing_state",onInsertValue = "0")
    @Schema(description = "审核状态（0：未审核；1：已通过；2：未通过）")
    private Integer auditingState;

    /**
    * 审核时间
    */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(value = "auditing_time")
    @Schema(description = "审核时间")
    private Date auditingTime;

    /**
    * 创建时间
    */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(value = "create_time",onInsertValue = "now()")
    @Schema(description = "创建时间")
    private Date createTime;

    /**
    * 修改时间
    */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(value = "update_time",onUpdateValue = "now()")
    @Schema(description = "修改时间")
    private Date updateTime;

    /**
    * 是否存在数据(0、不存在；1、存在)
    */
    @Column(value = "exist",onInsertValue = "1",isLogicDelete = true)
    @Schema(description = "是否存在数据(0、不存在；1、存在)")
    private Integer exist;

    @Column(ignore = true)
    @Schema(description = "页数")
    private Integer page;

    @Column(ignore = true)
    @Schema(description = "条数")
    private Integer limit;

    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(ignore = true)
    @Schema(description = "查询开始时间")
    private Date queryBeginTime;

    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(ignore = true)
    @Schema(description = "查询结束时间")
    private Date queryEndTime;

}
